
import request from '@/utils/request'
const url = "http://192.168.0.173:8088";
// export function login(data) {
//   return request({
//     url: '/user/login',
//     method: 'post',
//     data
//   })
// }
export function login(data) {
  return request({
    url: '/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/user/info',
    method: 'get',
    params: {
      token
    }
  })
}

export function logout() {
  return request({
    url: '/login/out',
    method: 'post'
  })
}
export function fb(data) {
  return request({
    url: '/sortplan/query',
    method: 'post',
    data: data
  })
}
export function supervisor() {
  return request({
    url: '/sortline/query/line/supervisor',
    method: 'get',
  })
}
export function sortingDetails(id) {
  return request({
    url: '/sortplan/query/detail/'+ id,
    method: 'get',
  })
}
// 新增
export function insert(data) {
  return request({
    url: '/sortpack/insert',
    method: 'post',
    data: data
  })
}
// 查询商品数据
export function queryGoods() {
  return request({
    url: '/goods/query/options',
    method: 'post',
  })
}
export function cascadeGoods(id) {
  return request({
    url: '/goods/query/specification/options/'+id,
    method: 'get',
  })
}
export function print(id) {
  return request({
    url: '/sortplan/query/print/oneline/'+id,
    method: 'get',
  })
}
//装箱单详情
export function sortpack(id) {
  return request({
    url: '/sortpack/query/detail/'+id,
    method: 'get',
  })
}
// 查询所有路线
export function path() {
  return request({
    url:'/path/query/option',
    method: 'get',
  })
}
export function place(id) {
  return request({
    url:'/path/query/place/option/'+id,
    method: 'get',
  })
}
// 删除装货单
export function sortpackDelect(id) {
  return request({
    url:'/sortpack/delete/'+id,
    method: 'get',
  })
}
// 查询销售场地
export function xlsPlace() {
  return request({
    url:'/path/query/xls/place',
    method: 'get',
  })
}

export function device(id) {
  return request({
    url:'/path/query/xls/device/'+id,
    method: 'get',
  })
}
// 平均分配
export function avager(id) {
  return request({
    url:'/sortpack/avager/'+id,
    method: 'get',
  })
}
//入库
export function putStorage(data){
  return request({
    url:'/sortpack/storage'+'?id='+data,
    method: 'post',
  })
}
export function getSortingManagersList(id) {
  return request({
    url: '/sortline/supervisor/query',
    method: 'get'
  })
}
// 增加分拣单
export function getsortplan(data) {
  return request({
    url: '/sortplan/insert',
    method: 'post',
    data: data
  })
}
// 修改分拣详情里的基本资料
export function getsortplanupdate(data) {
  return request({
    url: '/sortplan/update',
    method: 'post',
    data: data
  })
}
// 增加修改分拣计划明细（一行）
export function getsavedetial(data) {
  return request({
    url: '/sortplan/savedetial',
    method: 'post',
    data: data
  })
}
// 删除分拣单列表
export function sortplandele(id) {
  return request({
    url: '/sortplan/delete?id=' + id,
    method: 'post'
  })
}
// 获取商品列表
export function getqueryList(data) {
  return request({
    url: '/goods/query/list',
    method: 'post',
    data: data
  })
}
// 删除分拣明细
export function sortplanDelete(data) {
  return request({
    url: '/sortplan/detail/delete' + '?id=' + data,
    method: 'post'
  })
}
// 复制昨天
export function yesterday(data) {
  return request({
    url: '/sortplan/copy/yesterday',
    method: 'post',
    data:data
  })
}
export function deliverList(data) {
  return request({
    url:'/path/deliver/list',
    method: 'post',
    data:data
  })
}
// 编辑商品列表
export function specification(data) {
  return request({
    url: '/goods/update/specification',
    method: 'post',
    data: data
  })
}

//当个完成
export function oneFinally(id) {
  return request({
    url: `/sortpack/one/finally?id=${id}`,
    method: 'post',
  })
}
//全部完成
export function allFinally(id) {
  return request({
    url: `/sortpack/all/finally?id=${id}`,
    method: 'post',
  })
}
//编辑一行
export function sortpackEdit(data) {
  return request({
    url: '/sortpack/edit',
    method: 'post',
    data
  })
}

//场地装箱单列表
export function placepackList() {
  return request({
    url: '/placepack/list',
    method: 'post',
  })
}
//场地装箱详情
export function placeDetail(id) {
  return request({
    url:`/placepack/detail/${id}` ,
    method: 'get',
  })
}
//修改重量
export function placeEdit(data) {
  return request({
    url:'/placepack/edit' ,
    method: 'post',
    data
  })
}